package org.evej.apiparser.model;

import java.io.Serializable;
import java.util.Date;

public class ApiDocumentCacheInfo implements Serializable {

    private static final long serialVersionUID = 5353427463L;

    private final Date retievalTime;
    private final Date cachedUntil;

    private ApiDocumentCacheInfo(Builder builder) {
        this.retievalTime = new Date(builder.retrievalTime.getTime());
        this.cachedUntil = new Date(builder.cachedUntil.getTime());
    }
    
    public Date getRetievalTime() {
        return retievalTime;
    }

    public Date getCachedUntil() {
        return cachedUntil;
    }
    
    public static class Builder {
        
        private Date retrievalTime;
        private Date cachedUntil;

        public void setRetrievalTime(Date retrievalTime) {
            this.retrievalTime = retrievalTime;
        }

        public void setCachedUntil(Date cachedUntil) {
            this.cachedUntil = cachedUntil;
        }
        
        public ApiDocumentCacheInfo build() {
            return new ApiDocumentCacheInfo(this);
        }
    }
}
